package com.bins.dentist.clinic.enums;

import com.bins.dentist.clinic.utils.StringUtil;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;

@NoArgsConstructor
@AllArgsConstructor
public enum UserStatusEnum {

    VALID(1, "正常"),
    LOCKED(2, "锁定"),
    ;

    private Integer status;

    private String statusName;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public static String getUserStatusName(Integer status) {
        if (ObjectUtils.isEmpty(status)) {
            return StringUtil.EMPTY;
        }
        for (UserStatusEnum statusEnum : UserStatusEnum.values()) {
            if (statusEnum.status == status) {
                return statusEnum.statusName;
            }
        }
        return StringUtil.EMPTY;
    }
}
